/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package verins.DAO;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import verins.beans.Log;

/**
 *
 * @author hectdx
 */
public class LogDAO {
 
      public boolean save(Log entradaLog){
      boolean rOK=false;
     
      try{
        
         EntityManagerFactory emf = Persistence.createEntityManagerFactory("verinsPU");
         EntityManager em = emf.createEntityManager();
         em.getTransaction().begin();
         em.persist(entradaLog);
         em.getTransaction().commit();
         em.close();
         emf.close(); 
         rOK=true;
         
         return rOK;
         
      }catch(Exception ex){
          System.out.println(ex.getMessage());
          return false;
      } 
    }
          
}
